import java.util.ArrayList;

public class FixedSizeListBuffer extends ArrayList<Object> {
	int sizeL;

	public FixedSizeListBuffer(int size) {
		this.sizeL = size;
	}

	@Override
	public void add(int index, Object element) throws Error {
		System.out.println("NOT SUPPORTED");
	}

	@Override
	public boolean add(Object e) {
		if (super.size() == sizeL) {
			this.remove(sizeL);
		}
		return super.add(e);
	}
	
}
